<!DOCTYPE html>
<html>
	<head>
		<title><%= title %></title>
		<link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.css">
		<link rel='stylesheet' href='/stylesheets/style.css' />		
	</head>
	<body>
		<header> 
			<!-- <h1><%= title %></h1> -->
			<nav class="navbar navbar-inverse navbar-fixed-top">
				<div class="container">
					<div class="navbar-header">
				      	<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				        	<span class="sr-only">Toggle navigation</span>
				        	<span class="icon-bar"></span>
				        	<span class="icon-bar"></span>
				       	 	<span class="icon-bar"></span>
				      	</button>
				      	<a class="navbar-brand" href="#">粟米</a>
				    </div>
				    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				    	<ul class="nav navbar-nav">
							<li class="active"><a href="/" title="主页">主页</a></li>
							<li><a href="/archive" title="存档">存档</a></li>
							<li><a href="/tags" title="标签">标签</a></li>
							<% if(user){ %>
							<li><a href="/post" title="发表">发布</a></li>
							<li><a href="/upload" title="上传">上传</a></li>
							<li><a href="/logout" title="登出">登出</a></li>
							<li><a href="/u/<%= user.name %>">用户：<%= user.name %></a></li>
							<% } else{ %>
							<li><a href="/login" title="登录" data-toggle="modal" data-target=".bs-example-modal-sm">登录</a></li>
							<li><a href="/reg" title="注册">注册</a></li>
							<% } %>
					    </ul>
					</div>
				</div>
			</nav>
			<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
			  <div class="modal-dialog modal-sm">
			    <div class="modal-content">
			    </div>
			  </div>
			</div>
			
		</header>
		<div class="container">
		
  	<article>
  	<% if(success){ %>
  	<p class="mes bg-success">
  		<%= success %>
  	</p>
  	<% } %>
  	<% if(error){ %>
  	<p class="mes bg-danger">
  		<%= error %>
  	</p>
  	<% } %>